<!DOCTYPE html>
<html>
  
  <head>
  	<style>
  		#canva{
  			background:rgba(255,255,255,255);
  		}
  	</style>
    <script type="text/javascript">
    
     var canvas = document.createElement('canvas');
     var context = canvas.getContext('2d');
     var image = new Image();
     image.src = '微信图片_20170605174255.jpg';
     image.crossOrigin = 'Anonymous';
     image.onload = function() {   
     	//将图片按像素写入画布    
     	context.drawImage(image, 0, 0, this.width, this.height);  
     	//读取图片某位置像素信息(x,y为需要读取的像素位置)  
     	imageData = context.getImageData(20, 30, 1, 1).data;
     	alert(imageData);
     	console.log(imageData);
     	
     }
    </script>
  </head>
  <div style="width: 50px;height: 50px;" id="canva"></div>
  <body>
    
  </body>

</html>